package de.openkanban.server.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import de.openkanban.server.dao.BoardDao;
import de.openkanban.server.domain.Activity;
import de.openkanban.server.domain.Board;
import de.openkanban.server.domain.User;
import de.openkanban.server.service.BoardService;
import de.openkanban.shared.util.StatusCodes;

@Service
public class BoardServiceImpl implements BoardService {

	@Autowired
	private BoardDao boardDao;

	@Override
	public Board getBoardById(Long boardId) {
		return boardDao.getBoardById(boardId);
	}

	@Override
	public List<Board> getAll() {
		return boardDao.getAll();
	}

	@Override
	public Board createBoard(Board board, Long userId) {
		return boardDao.createBoard(board, userId);
	}

	@Override
	public Activity addActivityToBoard(Long parentBoardId, Activity newActivity) {
		return boardDao.addActivityToBoard(parentBoardId, newActivity);
	}

	@Override
	public Board removeBoard(Board board) {
		return boardDao.removeBoard(board);
	}

	@Override
	public Board updateBoard(Board board) {
		return boardDao.updateBoard(board);
	}

	@Override
	public StatusCodes addContactToBoard(Long parentBoardId, User newUser) {
		return boardDao.addContactToBoard(parentBoardId, newUser);
	}

	public void setBoardDao(BoardDao boardDao) {
		this.boardDao = boardDao;
	}

	@Override
	public StatusCodes removeContactFromBoard(Long parentBoardId, Long userId) {
		return boardDao.removeContactFromBoard(parentBoardId, userId);
	}

	@Override
	public Board getBoardByActivityIdLong(Long parentActivityId) {
		return boardDao.getBoardByActivityId(parentActivityId);
	}

	@Override
	public Board getDefaultBoardByUserId(Long userId) {
		return boardDao.getDefaultBoardByUserId(userId);
	}

	@Override
	public Long getNextBoardId(Long currentBoardId, Long userId) {
		return boardDao.getNextBoardId(currentBoardId, userId);
	}

	@Override
	public Long getPriorBoardId(Long currentBoardId, Long userId) {
		return boardDao.getPriorBoardId(currentBoardId, userId);
	}

}
